//
//  BaseTableView.swift
//  Kool Car
//
//  Created by huangweiqiang on 2022/2/6.
//

import UIKit

extension UITableViewController {
    open override func viewWillAppear(_ animated: Bool) {
        
    }
}

class BaseTableView: UITableView {
    override init(frame: CGRect, style: UITableViewStyle) {
        super.init(frame: frame, style: style)
        self.backgroundColor = Theme.F5Color
        self.separatorStyle = .none
        self.delaysContentTouches = false
         if #available(iOS 11.0, *) {
            self.estimatedRowHeight = 2
            self.estimatedSectionFooterHeight = 0.01
            self.estimatedSectionHeaderHeight = 0.01

            self.contentInsetAdjustmentBehavior = .never
            self.scrollIndicatorInsets = self.contentInset
        }
        if #available(iOS 15.0, *) {
            self.sectionHeaderTopPadding = 0
        }

    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension UITableView: UIGestureRecognizerDelegate {
    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
        return false
    }
    
 
}
